import http from '@/utils/http';

export function getMeInfo() {
    return http.post('/user/getMeInfo');
}

export function changePassword(form) {
    return http.post('/user/changePassword', form);
}

export function saveNickName(nickname) {
    return http.post('/user/saveInfo', { nickname });
}

export function saveHeadImg(avatar) {
    return http.post('/user/saveInfo', { avatar });
}

export function savePushState(pushState) {
    return http.post('/user/saveInfo', { pushState });
}

export function getPushState() {
    return http.get('/user/pushState');
}

export function postPushState(state) {
    return http.post(`/user/pushState/${state}`);
}

export function putPushStateBatch(stateStr) {
    return http.put(`/user/update/pushStateBatch/${stateStr}`);
}

// 策略列表
export function getPushStateList() {
    return http.get(`/user/pushStrategy/get`);
}
// 选择策略保存
export function pushStateUpdate(data) {
    return http({
        url: '/push/setting/update',
        method: 'post',
        params: data,
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded',
        }
    });
}
// 邀请列表
export function getInviteList(data) {
    return http.get(`/invite/user/get`, data);
}
